<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生入住-宿管系统</title>
    <link rel="stylesheet" href="../../css/basicLayout.css">

    <style type="text/css">
        #studentInForm{
            width: 500px;
            height: 500px;
            margin: 0 auto;
        }

        #studentInForm form table{
            padding-top: 50px;
            line-height: 50px;
        }
    </style>
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/index"> 学生管理</a></li>
        <li><a href="${pageContext.request.contextPath}/class/index"> 班级管理</a></li>
        <li><a href="${pageContext.request.contextPath}/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>学生管理功能</label>
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/add/index">学生入住</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <!--学生入住表单-->
    <div id="studentInForm">
        <form action="${pageContext.request.contextPath}/student/add/execute" method="post"enctype="multipart/form-data">
            <table>
                <tr>
                    <td>姓名：</td>
                    <td><input type="text" id="userName" name="userName" value="${username}"></td>
                </tr>
                  <tr>
                    <td>头像：</td>
                    <td><input type="file" id="photo" name="photo" value=""></td>
                </tr>

                <tr>
                    <td>性别：</td>
                    <td>
                        <c:if test="${empty sex}">
                            <label for="man">男：</label><input type="radio" id="man" name="sex" value="1" checked="checked">
                            <label for="woman">女：</label><input type="radio" id="woman" name="sex" value="0">
                        </c:if>
                        <c:if test="${sex==1}">
                            <label for="man">男：</label><input type="radio" id="man" name="sex" value="1" checked="checked">
                            <label for="woman">女：</label><input type="radio" id="woman" name="sex" value="0">
                        </c:if>
                         <c:if test="${sex==0}">
                            <label for="man">男：</label><input type="radio" id="man" name="sex" value="1" >
                            <label for="woman">女：</label><input type="radio" id="woman" name="sex" value="0" checked="checked">
                        </c:if>

                        <input type="submit" value="刷新房间信息" name="refresh"/>
                    </td>

                </tr>

                <tr>
                    <td>班级：</td>
                    <td>
                        <select name="allClass" id="allClass">
                            <c:forEach items="${allClasses}" var="cla">
                            <option value="${cla.className}" selected="selected">${cla.className}</option>
                            </c:forEach>
                        </select>
                    </td>
                </tr>


                <tr>
                    <td>房间：</td>
                    <td>
                        <select name="allRoom" id="allRoom">
                            <c:forEach items="${canInRooms}" var="room">
                            <option value="${room.roomAddress}">${room.roomAddress}</option>
                            </c:forEach>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td>电话：</td>
                    <td><input type="phone" id="phone" name="phone" value="${phone}"></td>
                </tr>
                <tr>
                    <td>入住时间：</td>
                    <td><input type="date" id="inTime" name="inTime" value="${inTime}"></td>
                </tr>
                <tr>
                    <td><input type="submit" value="提交"></td>
                    <td><input type="reset" value="重置"></td>
                </tr>
            </table>
        </form>
    </div>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>